#ifndef __ESC_H__
#define __ESC_H__

#include <stm32f4xx_hal.h>
#include <usart.h>
#include <dma.h>
#include <math.h>
#include <cJSON.h>
#include "aht30.h"
#include "adc.h"

#define ESC_PRINTF       USART_Printf
#define ESC_Get_recState USART_Get_recState
#define ESC_ReturnRxData USART_ReturnRxData

#define STATUS_PAUSE     0xFF
#define STATUS_RUN       0x00

#define HEARTBEAT        200

typedef enum {
  esc_date = 0x01,
  esc_time,
  esc_elec,
  esc_wifi,
} esc_pkg_t;

void esc_init(UART_HandleTypeDef *huart, uint32_t (*tickhook)(void));
void esc_handler(void);

#endif